using System;
using System.Collections.Generic;
using System.Text;
using CodePlex.Resourceful;

namespace CodePlex.SpaceBlock.UI
{
    public class FileSystemInfo
    {
        private readonly NameValuePairs _publicSettings;
        private readonly NameValuePairs _privateSettings;

        public FileSystemInfo()
            : this(new NameValuePairs(), new NameValuePairs())
        {
            this.ID = Guid.NewGuid().ToString();
        }

        public NameValuePairs PublicSettings 
        { 
            get 
            { 
                return _publicSettings; 
            } 
        }

        public NameValuePairs PrivateSettings 
        { 
            get 
            { 
                return _privateSettings; 
            } 
        }

        public FileSystemInfo(NameValuePairs publicSettings, NameValuePairs privateSettings)
        {
            _publicSettings = publicSettings;

            if (privateSettings == null)
            {
                privateSettings = new NameValuePairs();
                privateSettings["ID"] = publicSettings["ID"];
            }

            _privateSettings = privateSettings;
        }

        public string Caption
        {
            get
            {
                return _publicSettings["Caption"];
            }
            set
            {
                _publicSettings["Caption"] = value;
            }
        }

        public string Type
        {
            get
            {
                return _publicSettings["Type"];
            }
            set
            {
                _publicSettings["Type"] = value;
            }
        }

        public string ID
        {
            get
            {
                return _publicSettings["ID"];
            }
            private set
            {
                _publicSettings["ID"] = value;
                _privateSettings["ID"] = value;
            }
        }
    }
}
